package dw.spring3.rest.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
	@RequestMapping(method=RequestMethod.POST, value="/users")
	@ResponseBody
	 public Map<String, Object> getUsers(@RequestBody Map<String, Object> map){ 
		List taskVos = new ArrayList();
		for(int i=0;i<100;i++){
			Map vo=new HashMap();
			vo.put("userId", i);
			vo.put("userName", "name"+i);
			vo.put("userAge", 77);
			taskVos.add(vo);
		}
	    Map taskVo = new HashMap();
	    taskVo.put("identifier", "userId");
	    taskVo.put("items", taskVos);
	    return taskVo;
    }
}
